import 'dart:io';

import 'package:path_provider/path_provider.dart';

class FileUtil {
  static FileUtil? _instance;

  factory FileUtil() {
    _instance ??= FileUtil._();
    return _instance!;
  }

  FileUtil._();

  Future<String> getSavePath(String endPath) async {
    Directory tempDir = await getTemporaryDirectory();
    String path = tempDir.path + endPath;
    Directory directory = Directory(path); // 文件夹
    if (!directory.existsSync()) {
      directory.createSync();
    }

    return path;
  }
}
